home *** CD-ROM | disk | FTP | other *** search
/ Garden Fax: Fruits, Vegetables & Herbs / Garden Fax - Fruits, Vegetables & Herbs (1991)(CDTV Publishing)[!].iso / system / basicdemos / library (.txt) < prev    next >
AmigaBASIC Source Code  |  1978-01-06  |  1KB  |  63 lines

  1. REM - This demo program shows how to
  2. REM - invoke Amiga library routines
  3. REM - from Amiga-BASIC
  4.  
  5. DECLARE FUNCTION AskSoftStyle& LIBRARY
  6. DECLARE FUNCTION OpenFont& LIBRARY
  7. DECLARE FUNCTION Execute& LIBRARY
  8.  
  9.   LIBRARY "graphics.library"
  10.  
  11.   enable%=AskSoftStyle&(WINDOW(8))
  12.   Font "topaz.font",8,0,0
  13.   FOR i=0 TO 4
  14.     SetStyle CINT(2^i)
  15.   NEXT i
  16.  
  17.   Font "topaz.font",9,0,0
  18.   enable%=AskSoftStyle&(WINDOW(8))
  19.   FOR i=0 TO 4
  20.     SetStyle CINT(2^i)
  21.   NEXT i
  22.  
  23.   SetStyle 0
  24.   Font "",0,0,0  'Causes last pFont to be closed
  25.  
  26.   REM --- The next line only works
  27.   REM --- under CLI, not WorkBench
  28.   ' DosLibDemo
  29.   LIBRARY CLOSE
  30. END
  31.  
  32. SUB Font(fontName$, height%, style%, prefs%) STATIC
  33.   SHARED pFont&
  34.   IF pFont&<>0 THEN CALL CloseFont(pFont&)
  35.   fontName0$=fontName$+CHR$(0)
  36.   textAttr&(0)=SADD(fontName0$)
  37.   textAttr&(1)=height%*65536 + style%*256 + prefs%
  38.   pFont&=OpenFont&(VARPTR(textAttr&(0)))
  39.   IF pFont& <> 0 THEN SetFont WINDOW(8),pFont&
  40. END SUB
  41.  
  42. SUB SetStyle(mask%) STATIC
  43.   SHARED enable%
  44.   SetSoftStyle WINDOW(8),mask%,enable%
  45.   PRINT "SetSoftStyle(";mask%;")"
  46. END SUB
  47.  
  48. SUB DosLibDemo STATIC
  49.   LIBRARY "dos.library"
  50.   'this invokes the dos.library Execute function
  51.   x=Execute&(SADD("list >RAM:temp"+CHR$(0)), 0, 0)
  52.   OPEN "RAM:temp" FOR INPUT AS 1
  53.   WHILE NOT EOF(1)
  54.     LINE INPUT #1,a$
  55.     PRINT a$
  56.   WEND
  57.   CLOSE
  58.   KILL "RAM:temp"
  59. END SUB
  60.  
  61.  
  62.  
  63.